package cn.liontalk.ChainResponsibilityPattern;

import cn.liontalk.ChainResponsibilityPattern.customer.Customer;
import cn.liontalk.ChainResponsibilityPattern.factory.PriceHandlerFactory;

import java.util.Random;

public class ChainResponsibilityPatternTest {
    public static void main(String[] args) {
        Customer customer = new Customer();
        customer.setPriceHandler(PriceHandlerFactory.createPriceHandler());
        Random random = new Random();
        for (int i = 0; i < 100; i++) {
            customer.requestDiscount(random.nextFloat());
        }
    }
}
